package com.qing.design.patterns.memento.example;

/**
 * 操作人员，单一职责原则，解耦
 */
public class ConfigOriginator {

    private ConfigFile configFile;


    //当前文件 备份
    public ConfigMemento saveMemento(){
        return  new ConfigMemento(configFile);
    }

    //获取备份到当前
    public  void getMemento(ConfigMemento memento){
       this.configFile=memento.getConfigFile();
    }



    public ConfigFile getConfigFile() {
        return configFile;
    }

    public void setConfigFile(ConfigFile configFile) {
        this.configFile = configFile;
    }
}
